<!--edit page create by pionner at Tue Nov 25 15:11:25 CST 2008-->
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@taglib uri="ttp://www.security.com/tag" prefix="sc"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.pioneer.app.dev.osuser.user.*"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
	<script language="javascript">
	function IsEmpty()
{
var userName=document.addform.userName.value;
var birthday=document.addform.birthday.value;
if(userName==0||birthday==0){
alert("请填写完整内容！");
return;
}

document.addform.submit();
}
</script>
	
	
	
	<base href="<%=basePath%>">
		<title>Userlist</title>
		<link rel="stylesheet" href="css/style.css">
		<link href="template/css.css" rel="stylesheet" type="text/css">
		<link rel='stylesheet' type='text/css' href='css/table.css'>
		<link rel="stylesheet" type="text/css" media="all" href="<%=path%>/js/calendar/calendar-win2k-cold-1.css" title="win2k-cold-1" />
    
		<script type="text/javascript" src="<%=path%>/js/calendar/calendar.js"></script>
	<script type="text/javascript" src="<%=path%>/js/calendar/calendar-setup.js"></script>
	<script type="text/javascript" src="<%=path%>/js/calendar/calendar-zh1.js"></script> 
	
		<script src='js/comm.js'></script>
	</head>
	<body>
		<table width="200" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td width="90"><img src="images/loc-head.jpg" width="90" height="24"></td>
				<td valign="middle" nowrap background="images/loc-bg.jpg">用户编辑-<s:property value="userName"/></td>
				<td width="12"><img src="images/loc-tail.jpg" width="12" height="24"></td>
			</tr>
		</table><br>		
		<table border="0" width="100%"><tr><td width="60%">
		<s:form name="addform"  action="userlistSave.action">
			<table width='100%' border='0' cellspacing='1' class="ipttable">
				<s:hidden name='id' id="idCol" label='id'/>
				<s:hidden name='departmentId' label='departmentId'/>
				<s:textfield name='userName' label='用户名' cssClass="input130"/>
				<s:textfield name='cname' label='中文姓名' cssClass="input130"/>
				<s:textfield name="birthday" readonly="true" label='生日（1980-01-01）' value="%{getText('global.format.date',{birthday})}" cssClass="input130"/>
				<s:password  name='userPwd'  label='用户密码' size="22" cssClass="input130"/>
				<s:textfield name='telphone' label='手机号码' cssClass="input130"/>		
<s:textfield name='userId' label='身份证' cssClass="input130"/>		
<%Userlist ul=(Userlist)request.getAttribute("userlist"); %>
<%if(ul.getKind()==null || ul.getKind().equals("")){}else{ %>	
				<tr><td>

<label class="label">人员性质:</label></td><td>
					<select name="kind">
						<option value="固定" <%if("固定".equals(ul.getKind())){out.print("selected=\"selected\"");} %>>固定</option>
						<option value="流动" <%if("流动".equals(ul.getKind())){out.print("selected=\"selected\"");} %>>流动</option>
					</select>
				</td></tr>		
<tr><td>

<label class="label">自动发短信:</label></td><td>
					<select name="smsState">
						<option value="1" <%if(ul.getSmsState()!=null&&ul.getSmsState().equals(1)){out.print("selected=\"selected\"");} %>>是</option>
						<option value="0" <%if(ul.getSmsState()!=null&&ul.getSmsState().equals(0)){out.print("selected=\"selected\"");} %>>否</option>
					</select>
				</td></tr>		
				<%} %>
				<s:textfield name='address' label='地址' cssClass="input230"/>
				
			</table>
			<table width='100%' border='0' cellspacing='0' >
			<tr>
			<td align="center">
			<input type="button" value="提交" onClick="javascript:IsEmpty()" class="submitbtn">
			<input type="reset" value="重置" class="resetbtn">
			<input type="button" value="返回" onClick="javascript:history.back(-1)" class="backbtn">
			<sc:component processcode="user_roloe_proview" >
				<input type="button" value="授权" onClick="openpreview()" class="selectbtn">
			</sc:component>
			</td>
			</tr>
			</table>
		</s:form>
		</td>
		
		</tr></table>
	</body>
</html>
<script type="text/javascript">
<!--
	function openpreview(userId){
		window.location.href="roleCheckList.action?rlid="+document.getElementById('idCol').value;
	
		/**
		var title = "用户角色"; 
		var url = 'roleCheckList.action?rlid='+userId;
		var pageUrl='roleCheckList.action?rlid='+userId;
		var paraObj = new Object();
		paraObj.url=url;
		paraObj.title=title;
		//var obj=document.getElementById('toPersons');
		//paraObj.input=obj;
		var sFeatures = 'help:no;status:1;dialogHeight:500px;dialogWidth:350px;center:1';
	    var rtnObj= window.showModalDialog(pageUrl,paraObj,sFeatures );
	    //alert('rtnObj='+rtnObj);
		if(rtnObj){
			var result=rtnObj.result;
			//obj.value=result;
		}else{
    		
    	}
    	**/
	}
//-->

Calendar.setup(
		    {
		      inputField  : 'birthday',         // ID of the input field
		      ifFormat    : "%Y-%m-%d",    // the date format
		      onSelect   : onSelect,
		      showsTime : false
		    }
		  );
		 
function onSelect(calendar, date) {
    
    	var curEdt = document.getElementById(calendar.params.inputField.id);
      	curEdt.value = date;
      
    
	};	 
</script>
